package com.ssy.lingxi.order.model.vo.buyer.request;

import com.ssy.lingxi.order.handler.annotation.BuyerOrderShopTypeAnnotation;
import com.ssy.lingxi.order.handler.annotation.ManageShopEnvironmentAnnotation;
import com.ssy.lingxi.order.handler.annotation.OrderModeAnnotation;
import com.ssy.lingxi.order.handler.annotation.OrderPayTypeAnnotation;
import com.ssy.lingxi.order.model.vo.basic.request.*;

import javax.validation.Valid;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 创建采购订单接口参数VO
 * @author 万宁
 * @version 2.0.0
 * @date 2021-07-17
 */
public class OldBuyerOrderVO implements Serializable {
    private static final long serialVersionUID = -5792628696318098343L;

    /**
     * 订单来源商城Id
     */
    @NotNull(message = "订单来源商城Id不能为空")
    private Long shopId;

    /**
     * 商城类型
     */
    @NotNull(message = "商城类型不能为空")
    @BuyerOrderShopTypeAnnotation
    private Integer shopType;

    /**
     * 商城环境
     */
    @NotNull
    @ManageShopEnvironmentAnnotation
    private Integer shopEnvironment;

    /**
     * 订单来源商城名称
     */
    @NotBlank(message = "订单来源商城名称不能为空")
    @Size(max = 50, message = "订单来源商城名称最长50个字符")
    private String shopName;

    /**
     * 下单模式
     */
    @NotNull(message = "下单模式不能为空")
    @OrderModeAnnotation
    private Integer orderMode;

    /**
     * 订单摘要
     */
    @Size(max = 100, message = "订单摘要最长100个字符")
    private String digest;

    /**
     * 关联单号Id（商品报价单、商品询价单等）
     */
    private Long quoteId;

    /**
     * 关联单号（商品报价单、商品询价单等）
     */
    @Size(max = 20, message = "关联单号最长20个字符")
    private String quoteNo;

    /**
     *  支付方式，0-无需支付，1-线上支付，2-线下支付，3-授信额度支付，4-货到付款
     */
    @NotNull(message = "支付方式要大于等于0")
    @OrderPayTypeAnnotation
    private Integer payType;

    /**
     * 支付渠道，0-无需支付，1-支付宝，2-微信，3-银联，4-余额支付，5-线下支付线上确认，6-授信额度支付，7-货到付款
     */
    @NotNull(message = "支付渠道要大于等于0")
    @PositiveOrZero(message = "支付渠道要大于等于0")
    private Integer payChannel;

    /**
     * 运费
     */
    @NotNull(message = "运费金额要大于等于0")
    @PositiveOrZero(message = "运费金额要大于等于0")
    private BigDecimal freight;

    /**
     * 收货地址，如商品配送方式中包含“物流”，则必须填写
     */
    @Valid
    private OrderConsigneeVO consignee;

    /**
     * 发票信息，如订单没有发票不需要填写此字段
     */
    @Valid
    private OrderInvoiceVO invoice;

    /**
     * 合同信息，如订单没有合同不需要填写此字段
     */
    @Valid
    private OrderContractVO contract;

    /**
     * 商品列表
     */
    @NotEmpty(message = "商品列表不能为空")
    @Valid
    private List<OrderProductVO> products;

    /**
     * 订单送货时间列表
     */
    @Valid
    private List<BuyerOrderDeliverTimeVO> deliverTimes;

    /**
     * 订单其他要求。如订单没有其他要求不需要填写此字段
     */
    private OrderRequirementVO requirement;

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Integer getShopType() {
        return shopType;
    }

    public void setShopType(Integer shopType) {
        this.shopType = shopType;
    }

    public Integer getShopEnvironment() {
        return shopEnvironment;
    }

    public void setShopEnvironment(Integer shopEnvironment) {
        this.shopEnvironment = shopEnvironment;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public Integer getOrderMode() {
        return orderMode;
    }

    public void setOrderMode(Integer orderMode) {
        this.orderMode = orderMode;
    }

    public String getDigest() {
        return digest;
    }

    public void setDigest(String digest) {
        this.digest = digest;
    }

    public Long getQuoteId() {
        return quoteId;
    }

    public void setQuoteId(Long quoteId) {
        this.quoteId = quoteId;
    }

    public String getQuoteNo() {
        return quoteNo;
    }

    public void setQuoteNo(String quoteNo) {
        this.quoteNo = quoteNo;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public Integer getPayChannel() {
        return payChannel;
    }

    public void setPayChannel(Integer payChannel) {
        this.payChannel = payChannel;
    }

    public BigDecimal getFreight() {
        return freight;
    }

    public void setFreight(BigDecimal freight) {
        this.freight = freight;
    }

    public OrderConsigneeVO getConsignee() {
        return consignee;
    }

    public void setConsignee(OrderConsigneeVO consignee) {
        this.consignee = consignee;
    }

    public OrderInvoiceVO getInvoice() {
        return invoice;
    }

    public void setInvoice(OrderInvoiceVO invoice) {
        this.invoice = invoice;
    }

    public OrderContractVO getContract() {
        return contract;
    }

    public void setContract(OrderContractVO contract) {
        this.contract = contract;
    }

    public List<OrderProductVO> getProducts() {
        return products;
    }

    public void setProducts(List<OrderProductVO> products) {
        this.products = products;
    }

    public OrderRequirementVO getRequirement() {
        return requirement;
    }

    public void setRequirement(OrderRequirementVO requirement) {
        this.requirement = requirement;
    }

    public List<BuyerOrderDeliverTimeVO> getDeliverTimes() {
        return deliverTimes;
    }

    public void setDeliverTimes(List<BuyerOrderDeliverTimeVO> deliverTimes) {
        this.deliverTimes = deliverTimes;
    }
}
